Compare data from the Disdrometer and Rain Gauge
Contents
Compare data from the Disdrometer and Rain GaugeΒΆ
import xarray as xr
import hvplot.xarray
import hvplot.pandas
import pandas as pd
import holoviews as hv
from distributed import Client, LocalCluster
hv.extension('bokeh')
Spin up a Dask ClusterΒΆ
cluster = LocalCluster()
client = Client(cluster)
client
distributed.diskutils - INFO - Found stale lock file and directory '/Users/mgrover/git_repos/SAILS-radar-analysis/notebooks/precipitation-exploration/dask-worker-space/worker-7gggry14', purging
distributed.diskutils - INFO - Found stale lock file and directory '/Users/mgrover/git_repos/SAILS-radar-analysis/notebooks/precipitation-exploration/dask-worker-space/worker-gu2trvj7', purging
distributed.diskutils - INFO - Found stale lock file and directory '/Users/mgrover/git_repos/SAILS-radar-analysis/notebooks/precipitation-exploration/dask-worker-space/worker-fosyqxv1', purging
distributed.diskutils - INFO - Found stale lock file and directory '/Users/mgrover/git_repos/SAILS-radar-analysis/notebooks/precipitation-exploration/dask-worker-space/worker-s50t2e4t', purging
Client
Client-17a27cdc-afb3-11ec-9549-acde48001122
| Connection method: Cluster object | Cluster type: distributed.LocalCluster |
| Dashboard: http://127.0.0.1:8787/status |
Cluster Info
LocalCluster
94902f8f
| Dashboard: http://127.0.0.1:8787/status | Workers: 4 |
| Total threads: 12 | Total memory: 16.00 GiB |
| Status: running | Using processes: True |
Scheduler Info
Scheduler
Scheduler-b24d500b-7d4e-42b2-be55-917686657001
| Comm: tcp://127.0.0.1:65491 | Workers: 4 |
| Dashboard: http://127.0.0.1:8787/status | Total threads: 12 |
| Started: Just now | Total memory: 16.00 GiB |
Workers
Worker: 0
| Comm: tcp://127.0.0.1:65506 | Total threads: 3 |
| Dashboard: http://127.0.0.1:65509/status | Memory: 4.00 GiB |
| Nanny: tcp://127.0.0.1:65497 | |
| Local directory: /Users/mgrover/git_repos/SAILS-radar-analysis/notebooks/precipitation-exploration/dask-worker-space/worker-ktdval7y | |
Worker: 1
| Comm: tcp://127.0.0.1:65510 | Total threads: 3 |
| Dashboard: http://127.0.0.1:65512/status | Memory: 4.00 GiB |
| Nanny: tcp://127.0.0.1:65496 | |
| Local directory: /Users/mgrover/git_repos/SAILS-radar-analysis/notebooks/precipitation-exploration/dask-worker-space/worker-n63y4mr7 | |
Worker: 2
| Comm: tcp://127.0.0.1:65502 | Total threads: 3 |
| Dashboard: http://127.0.0.1:65503/status | Memory: 4.00 GiB |
| Nanny: tcp://127.0.0.1:65494 | |
| Local directory: /Users/mgrover/git_repos/SAILS-radar-analysis/notebooks/precipitation-exploration/dask-worker-space/worker-kxjux7zt | |
Worker: 3
| Comm: tcp://127.0.0.1:65505 | Total threads: 3 |
| Dashboard: http://127.0.0.1:65507/status | Memory: 4.00 GiB |
| Nanny: tcp://127.0.0.1:65495 | |
| Local directory: /Users/mgrover/git_repos/SAILS-radar-analysis/notebooks/precipitation-exploration/dask-worker-space/worker-mwjl50pz | |
Read in the dataΒΆ
Here, we use data from:
a disdrometer (datastream:
gucldM1.b1)a rain gauge (datastream:
gucwbpluvio2M1.a1)
We use all the data available, you can query from this website: https://adc.arm.gov/discovery/#/
disdrometer_ds = xr.open_mfdataset('../../data/disdrometer/*')
gauge_ds = xr.open_mfdataset('../../data/rain-gauge/*')
Visualize the DataΒΆ
We use hvplot here to plot an interactive view of our data, utilizing rasterize to dynamically view our large datasets
from bokeh.models import DatetimeTickFormatter
def apply_formatter(plot, element):
plot.handles['xaxis'].formatter = DatetimeTickFormatter(hours='%m/%d/%Y \n %H:%M',
minutes='%m/%d/%Y \n %H:%M',
hourmin='%m/%d/%Y \n %H:%M',
days='%m/%d/%Y \n %H:%M',
months='%m/%d/%Y \n %H:%M')
snow_rate_plot = disdrometer_ds.snow_depth_intensity.hvplot.line(ylim=(0, 350), rasterize=True).opts(hooks=[apply_formatter])
bucket_accumulation = gauge_ds.intensity_rtnrt.hvplot.line(ylim=(0, 350), rasterize=True).opts(hooks=[apply_formatter])
View our Final VisualizationΒΆ
We can combine these into a single column of plots, matching the views/colorbars
(snow_rate_plot + bucket_accumulation).cols(1)